<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_course_items_video_current".
 *
 * @property string $id The primary identifier
 * @property string $course_id 课程ID
 * @property string $item_id 单元项ID
 * @property string $resource_id 视频ID，
 * @property string $user_id 用户ID
 * @property int $current_progress 当前时间进度
 * @property string $type 类型
 * @property string $is_end 是否观看结束1:没结束2:结束
 * @property string $resource 文件来自哪里：0本地；1资源库
 * @property string $create_by
 * @property string $create_time
 * @property string $update_by
 * @property string $update_time
 * @property int $del_flag
 */
class TCourseItemsVideoCurrent extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_course_items_video_current';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'create_time'], 'required'],
            [['current_progress', 'del_flag'], 'integer'],
            [['create_time', 'update_time'], 'safe'],
            [['id', 'course_id', 'item_id', 'resource_id', 'user_id', 'create_by', 'update_by'], 'string', 'max' => 36],
            [['type', 'is_end', 'resource'], 'string', 'max' => 64],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'course_id' => '课程ID',
            'item_id' => '章节ID',
            'file_id' => '视频ID',
            'user_id' => '用户ID',
            'current_progress' => '当前时间进度',
            'is_end' => '是否观看结束',
            'resource' => '文件来源',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => '删除状态',
        ];
    }
}
